<?php /* @var $this->list My_Html_List */; ?>
<div class="list-container" id="<?php echo $this->list->getId(); ?>">

    <?php if (true == $this->list->getShowTitle()): ?>
        <div class="list-title-container">
            <span class="list-title"><?php echo $this->translate($this->list->getTitle()); ?></span>
        </div>
    <?php endif; ?>

    <div class="list-paginator-container">
        <div class="list-paginator">
            <span class="list-paginator-prev-page-control">&lt;</span>
            Page <span class="list-paginator-current-page-number">1</span> / <span class="list-paginator-total-pages-number"><?php echo $this->list->getNumberOfPages(); ?></span>
            <span class="list-paginator-next-page-control">&gt;</span>
            Total items: <span class="list-paginator-total-items-number"><?php echo count($this->list->getData()); ?></span>

        </div>
    </div>

    <?php if (true == $this->list->getShowFilter()): ?>
        <div class="list-filter-container">
            <label class="list-filter-label"><?php echo $this->translate('Filter'); ?></label>
            <input type="text" class="list-paginator-filter-input">
        </div>
    <?php endif; ?>

    <?php if (true == $this->list->getShowOrderer()): ?>
        <div class="list-orderer-container">
            <label class="list-orderer-label"><?php echo $this->translate('Order by'); ?></label>
            <select class="list-paginator-orderer-select">
                <option value="__none__"><?php echo $this->translate('Select an option...'); ?></option>
                <?php if (is_array($this->list->getColumnKeys()) && count($this->list->getColumnKeys()) > 0): ?>
                    <?php foreach ($this->list->getColumnKeys() as $key): ?>
                        <option value="<?php echo $key; ?>"><?php echo $this->translate($key); ?></option>
                    <?php endforeach; ?>
                <?php endif; ?>
            </select>
        </div>
    <?php endif; ?>
    <div class="list-items-container">
        <ul class="list-items">
            <?php if (is_array($this->list->getData()) && count($this->list->getData())): ?>
                <?php $auxCtr = 0; ?>
                <?php foreach ($this->list->getData() as $data) : ?>
                    <?php $auxCtr++; ?>
                    <?php if ($auxCtr > $this->list->getItemsPerPage()): break;
                    endif; ?>
                    <li class="list-item"><?php echo $data[$this->list->getViewColumnKey()]; ?></li>
                <?php endforeach; ?>
            <?php endif; ?>
        </ul>
    </div>


</div>

<script type="text/javascript">
    $(function()
    {
        if (undefined == window.lists ) window.lists= {};
        window.lists['<?php echo $this->list->getId(); ?>'] = new My_Widget_List('#<?php echo $this->list->getId(); ?>', 
<?php echo $this->list->getData(true); ?>,
<?php echo $this->list->getJsConfiguration(); ?> );
        
                });
</script>